package com.jctrip.hotel.management.model.result;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@ApiModel(value = "获取价格政策接口-返回值")
@Data
@Builder
public class GetAllPricePolicyResult {
    @ApiModelProperty(value = "价格政策列表")
    private List<PricePolicyInfo> pricePolicyInfoList;

    @ApiModel(value = "价格政策对象")
    @Data
    @Builder
    public static class PricePolicyInfo{
        @ApiModelProperty(value = "主键id")
        private String id;

        @ApiModelProperty(value = "政策编号")
        private String pricePolicyId;

        @ApiModelProperty(value = "政策编号")
        private String pricePolicyCode;

        @ApiModelProperty(value = "价格政策名称")
        private String pricePolicyName;

        @ApiModelProperty(value = "供应来源")
        private String sourceCode;

        @ApiModelProperty(value = "供应名")
        private String sourceName;

        @ApiModelProperty(value = "供应商账户id，逗号分隔")
        private String sourceIds;

        @ApiModelProperty(value = "下单key列表")
        private List<KeyInfo> keyInfos;

        @ApiModelProperty(value = "投放渠道编号")
        private String routeId;

        @ApiModelProperty(value = "投放渠道名")
        private String routeName;

        @ApiModelProperty(value = "价格政策状态(0=关闭；1=开启)")
        private Integer pricePolicyStatus;

        @ApiModelProperty(value = "支付类型(1=预付；2=现付；3=信用类后付)")
        private Integer paymentType;

        @ApiModelProperty(value = "供应价格码")
        private String productCode;

        @ApiModelProperty(value = "早餐数量")
        private Integer breakfastCount;

        @ApiModelProperty(value = "容差金额")
        private BigDecimal tolerancePrice;

        @ApiModelProperty(value = "溢价区间列表")
        List<PricePolicyRangeInfo> pricePolicyRangeInfoList;
    }

    @ApiModel(value = "价格政策对象")
    @Data
    @Builder
    public static class PricePolicyRangeInfo{
        @ApiModelProperty(value = "主键id")
        private Long id;

        @ApiModelProperty(value = "价格区间最低值")
        private BigDecimal rangePriceMin;

        @ApiModelProperty(value = "价格区间最高值")
        private BigDecimal rangePriceMax;

        @ApiModelProperty(value = "加价率(0.05等于溢价5%)")
        private BigDecimal markupRate;

        @ApiModelProperty(value = "固定加价金额")
        private BigDecimal markupFixed;
    }

    @ApiModel(value = "下单key对象")
    @Data
    @Builder
    public static class KeyInfo{
        @ApiModelProperty("供应id")
        private String sourceId;

        @ApiModelProperty("供应名")
        private String sourceName;

        @ApiModelProperty("次数")
        private Integer times;
    }
}
